<?php
/*
 * Creative Bulletin Board Generation 3
 * Version 1.0 Beta 1
 +------------------------------------
 * Help Application Controller: Help File
 * Started: September 26, 2009 4:41 PM
 * Script version: 1.0
 */
class helpfile{
	public function __construct($id){
		global $db;
		$this->hid = intval($id);
		$query = $db->select("help", "*", "1", " WHERE `id` = {$this->hid}");
		if($query){
			if($db->num_rows($query) == 0){
				$this->status = false;
			}
			else{
				$this->help_file = $db->fetch_array($query);
				$this->status = true;
			}
		}
		else{
			$this->status = false;
		}
	}
	
	public function getStatus(){
		return $this->status;
	}
	
	public function getTitle(){
		return $this->help_file["title"];
	}
	
	public function getExcerpt(){
		return $this->help_file["excerpt"];
	}
	
	public function getContent(){
		return $this->help_file["content"];
	}
	
	public function delete(){
		global $db;
		$query = $db->query("DELETE FROM `".DB_PREFIX."help` WHERE `id` = {$this->hid} LIMIT 1");
		return $query;
	}
}
